package com.example.lijuan.myapplication.UI.Fragment;

import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.TextView;

import com.amap.api.maps2d.AMap;
import com.amap.api.maps2d.CameraUpdateFactory;
import com.amap.api.maps2d.MapView;
import com.amap.api.maps2d.model.BitmapDescriptor;
import com.amap.api.maps2d.model.BitmapDescriptorFactory;
import com.amap.api.maps2d.model.LatLng;
import com.amap.api.maps2d.model.Marker;
import com.amap.api.maps2d.model.MarkerOptions;
import com.amap.api.maps2d.model.PolylineOptions;
import com.example.lijuan.myapplication.R;
import com.example.lijuan.myapplication.Service.TripServices;
import com.example.lijuan.myapplication.Util.Constants;
import com.example.lijuan.myapplication.module.TripSummary;
import com.squareup.okhttp.Interceptor;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.Response;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;

import retrofit.Call;
import retrofit.Callback;
import retrofit.GsonConverterFactory;
import retrofit.Retrofit;

public class FragmentTripMain extends Fragment {
    View rootView;
    private MapView tripMapView;
    protected AMap aMap;
    private Marker deviceMarker;
    private TextView tx_last_trip;
    private ArrayList<LatLng> points;
    private Double longMax, longMin, latMax, latMin, longCenter, latCenter;
    private Button btnTripHistory;
    private FragmentManager fragmentManager;
    private FrameLayout frameLayout;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (null == fragmentManager) {
            fragmentManager = getFragmentManager();
        }
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        rootView = inflater.inflate(R.layout.fragment_trip_main, container, false);
        frameLayout = (FrameLayout) rootView.findViewById(R.id.fragment_car_trip);
        FragmentTransaction ft = getFragmentManager().beginTransaction();
        ft.add(R.id.fragment_car_trip, new FragmentCarTrip());
        ft.commit();
        return rootView;
    }



}
